﻿from Game.Poker.Card import Card

class Player:
    def __init__(self, name):
        self.name = name
        self.hand = []
        self.role = None  # 'landlord' or 'peasant'

    def sort_hand(self):
        # 按斗地主规则排序手牌
        order = {card: idx for idx, card in enumerate(Card.RANKS + ["BJ", "RJ"])}
        self.hand.sort(key=lambda x: order.get(x[:-1], 999))